// this function parses the zipcode returned by edgescape header
function ParseZipCode()
{
	var zipcode = "94102-94105+94107-94112+94114-94134+94137+94139-94147+94151+94153-94154+94156+94159-94164+94171-94172+94177+94188";

	// steps for listing out the zipcodes
	// split it first at the + and add to an array
	// then for the -, iterate from the start to the end

	// split the +
	var pluszip = zipcode.split("+");

	// at this stage, pluszip contains all the strings split at the +
	if (pluszip.length > 0)
	{
		// iterate through the array and split at the -
		// then find the start and end of the range
		// then iterate through the start - end

		for (var i = 0; i < pluszip.length; i++)
		{
			var s = pluszip[i];
			var minuszip = s.split("-");

			// its in the format of start-end or its a single zipcode
			// either way, extract the start and the end range of the string
			// the single zipcode will have the same start and end

			if (minuszip.length > 0)
			{
				// this gets the first and last element
				var start = minuszip[0];
				var end = minuszip[minuszip.length - 1];

			} // end if

			for (var j = start; j <= end; j++)
			{
				console.log ("zipcode = " + j);

			} // end for

		} // end if

	} // end if
	else
	{
		console.log ("Sorry, array cannot be empty!")

	} // end else
	
} // end function ParseZipCode